package com.fifth.user.controller.api;

import com.fifth.common.pojo.dto.CommonResult;
import com.fifth.common.pojo.entity.Link;
import com.fifth.common.pojo.entity.Order;
import com.fifth.common.pojo.entity.UserInfo;
import com.fifth.common.pojo.entity.UserPermission;
import com.fifth.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @作者：刘壬杉
 * @创建时间 2022/8/31 11:30
 **/
@RestController
@RequestMapping("api/user")
public class ApiUserController {
    @Autowired
    private UserService userService;

    /**
     * 根据tel查询用户信息
     * @param telephone
     * @return
     */
    @GetMapping("findByPhone/{telephone}")
    public UserInfo findByPhone(@PathVariable String telephone){
        return userService.findByPhone(telephone);
    }
    @GetMapping("getPermission")
    public List<UserPermission> getPermission(){
        return userService.getPermission();
    }
}
